Wind.css('fancy');
    Wind.use('fancy', function () {
	$(".fancybox").fancybox({
				padding: 0,

				openEffect : 'elastic',
				openSpeed  : 150,

				closeEffect : 'elastic',
				closeSpeed  : 150,

				closeClick : true,

				
			});
	})
	
	/*	

单图上传回调函数*/

	function upload_file(file, data){
							    	var data = $.parseJSON(data);
							    	var src = '';
							        if(data.status){
										
										
							      
									
											if(data.duo==undefined){
												
											  $("#"+data.field+"-div").hide();	
												
							        }
								
										
										
									
							        	src =data.savepath;
										
										if(data.action=="file"){
							        	$("#upload-box-"+data.field).html(
							        		
											
											'<p><input type="text" class="col-xs-8 col-sm-7" name="'+data.field+'" value="' + src + '" >  <a data-href="/Admin/File/del_file" data-url="' + src + '" data-field="'+data.field+'" class="del_att cust">删除</a></p>'
											
											
											
							        	);}
										else{
											
											$("#upload-box-"+data.field).html(
							        		
											
											'<p><input type="text" class="col-xs-8 col-sm-7" name="'+data.field+'" value="' + src + '" > <a class="fancybox" href="' + src + '" rel="'+data.field+' ">查看</a> <a data-href="/Admin/File/del_file	" data-url="' + src + '" data-field="'+data.field+'" class="del_att cust">删除</a></p>'
											
											
											
							        	);
											
											}
										
										
							        } else {
										
							        	 $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
							        	
							        }
							    }
								
								
	

								
								
							
								
								function upload_files(file, data){
							    	var data = $.parseJSON(data);
							    	var src = '';
							        if(data.status){
							     
							        	src =data.savepath;
										
											if(data.action=="file"){
												
												
							        	$("#upload-box-"+data.field).append(
							        		
											
											'<p><input type="text" class="col-xs-8 col-sm-7" name="'+data.field+'[]" value="' + src + '" > <a data-href="/Admin/File/del_file" data-url="' + src + '" data-field="'+data.field+'" class="del_att cust">删除</a></p>'
											
											
											
							        	);}
										else{
											$("#upload-box-"+data.field).append(
							        		
											
											'<p><input type="text" class="col-xs-8 col-sm-7" name="'+data.field+'[]" value="' + src + '" > <a class="fancybox" href="' + src + '" rel="'+data.field+' ">查看</a> <a data-href="/Admin/File/del_file" data-url="' + src + '" data-field="'+data.field+'" class="del_att cust">删除</a></p>'
											
											
											
							        	);
											
											}
										
							        } else {
										
							        	 $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
							        	
							        }
							    }
								
								
								
;$(function(){
	/*	
附件删除函数*/
	$('.del_att').live("click",function(){
	
	var that=$(this); 
	if($(this).data('href')!=undefined){
	$.ajax({
   type: "GET",
   url: $(this).data('href'),
   data: "att="+$(this).data('url'),
   success: function(data){
	     
	   
	   if (data.status == '1') {
		  
		    $("#"+that.data('field')+"-div").show();
		    that.parent().remove();
		
	   }else{
		   
		    $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
		   }
  
   }
   
});
	
	}
	
	else{
		  $("#"+that.data('id')+"-div").show();
		 that.parent().remove();
		
		}
	
	})
		
/*	添加外链函数*/
	
	$('.add-link').live("click",function(){
		
		var field=$(this).data('field');
		var rong=$("#upload-box-"+field);
		
		
		
			
			
			if($(this).data('duo')==undefined){
				 $("#"+field+"-div").hide();
				   
				rong.html(
				'<p><input type="text" class="col-xs-8 col-sm-7" name="'+field+'" >  <a  data-id="'+field+'" class="del_att cust">删除</a></p>')
			
				}else{
					rong.append(
				'<p><input type="text" class="col-xs-8 col-sm-7" name="'+field+'[]" >  <a  data-id="'+field+'" class="del_att cust">删除</a></p>')
			
					}	
				
			
			
			
		
		
		
		})
	
	});